package com.mingrisoft;

import java.sql.*;


public class AddUser {
    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.jdbc.Driver"); // 锟斤拷锟斤拷锟斤拷菘锟斤拷锟�

            String url = "jdbc:mysql://localhost:3306/db_database18"; // 锟斤拷锟斤拷锟斤拷菘锟絛b_database17锟斤拷URL
            String user = "root"; // 锟斤拷菘锟斤拷没锟斤拷锟�
            String password = "625722"; // 锟斤拷菘锟斤拷锟斤拷锟�
            Connection conn = DriverManager.getConnection(url, user, password); // 锟斤拷锟斤拷锟斤拷菘锟斤拷锟斤拷樱锟斤拷锟斤拷锟斤拷锟接讹拷锟斤拷conn
            String sql = "insert into test (user,password,department) values(938,4352,'锟斤拷锟斤拷锟斤拷')"; // 锟斤拷锟揭伙拷锟絪ql锟斤拷锟�
            Statement stmt = conn.createStatement(); // 锟斤拷锟斤拷一锟斤拷Statment锟斤拷锟斤拷
            stmt.executeUpdate(sql); // 执锟斤拷sql锟斤拷锟�
            conn.close(); // 锟截憋拷锟斤拷菘锟斤拷锟斤拷佣锟斤拷锟�
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
